{extend name="../application/admin/view/layout.html" /}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">

  <div class="row">
    <div class="col-sm-12">
      <div class="ibox float-e-margins">
        <div class="ibox-content">
          <form method="post" class="form-horizontal" id="set_pwd">
            <div class="form-group">
              <label class="col-sm-2 control-label">原密码</label>
              <div class="col-sm-10">
                <input type="password" class="form-control" name="old_pwd">
              </div>
            </div>

            <div class="form-group">
              <label class="col-sm-2 control-label">新密码</label>
              <div class="col-sm-10">
                <input type="password" class="form-control" name="password">
              </div>
            </div>

            <div class="form-group">
              <label class="col-sm-2 control-label">确认密码</label>
              <div class="col-sm-10">
                <input type="password" class="form-control" name="repassword">
              </div>
            </div>

            <div class="form-group">
              <div class="col-sm-4 col-sm-offset-2">
                <button class="btn btn-primary" type="button" id="sub">保存</button>
              </div>
            </div>

          </form>
        </div>
      </div>
    </div>
  </div>

</div>
{/block}

{block name="js"}

<script>
    $(function () {
        // 提交表单
        $('#sub').click(function () {
            http_post(
                "{:url('admin/admin/pwd')}",
                $('#set_pwd').serialize(),
                function (res) {
                    layer.msg('更新成功',{icon:1},function () {
                        location.replace("{:url('admin/login')}")
                    })
                }
            )
            return false;
        })
    })
</script>

{/block}
